Server-client applications, such as an Internet protocol television (IPTV) environment, usually rely on a server listening on one or more predefined ports for incoming connection requests. Generally, when testing an IPTV environment, it may be useful to simulate an IPTV server that can receive numerous connection requests and respond accordingly.
Some IPTV servers may use multiple interfaces and/or multiple IP addresses. To reduce the complexity involved for handling requests received via various simulated interfaces and/or addresses, an IPTV server simulator may be configured to receive all incoming connection requests via one network socket or logical endpoint. The socket may be registered to an event notification service so that whenever a new incoming connection request is received on the socket an event is generated. In response to the event, an IPTV server simulator or process therein may accept the new incoming connection request, e.g., using an accept function available in a Linux operating system. Using the connection request, a corresponding connection may be established between the simulator and the client.
While this setup works well for single-core (i.e., single processor) implementations, problems can arise with multi-core implementations. For example, in a multi-core implementation, each core may have a server process that is listening for events associated with the same socket. As such, all listening server processes may be notified of new connection requests and may all try to accept the connection requests. Because each server process may try to accept all incoming connection requests, distribution of connections across the cores may be random and unbalanced. As such, instead of each core handling the same number of connections, some cores may handle significantly more connections and other processors may handle significantly less connections which results in inefficient resource utilization.
Accordingly, in light of these difficulties, a need exists for improved methods, systems, and computer readable media for balancing incoming connections across multiple cores.